package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by HUAN169 on 2020/8/7.
 */
@RestController
public class HelloController {

    @Value("${my.name}")
    private String name;

    @Value("${my.age}")
    private int age;

    @RequestMapping
    public String hello()
    {
        return "hello wolrd!";
    }

    @RequestMapping("myinfo")
    public String myInfo()
    {
        System.out.println("my name :"+ name +",age :" + age);
        return "my name :"+ name +",age :" + age;
    }
}
